<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>以 CBC 模式加解密数据</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.mcrypt-cbc" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mcrypt_cbc</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">mcrypt_cbc</span> &mdash; <span class="dc-title">以 CBC 模式加解密数据</span></p>

 </div>
 
 <div id="function.mcrypt-cbc-refsynopsisdiv">
  <div class="warning"><strong class="warning">Warning</strong>
   
<p class="para">
 This function was <em class="emphasis">DEPRECATED</em> in PHP 5.5.0, and
 <em class="emphasis">REMOVED</em> in PHP 7.0.0.
</p>
<p class="para">
 Alternatives to this function include:
</p>

   <ul class="simplelist">
    <li class="member"><span class="function"><a href="mcrypt_decrypt.html" class="function">mcrypt_decrypt()</a></span></li>
    <li class="member"><span class="function"><a href="mcrypt_encrypt.html" class="function">mcrypt_encrypt()</a></span></li>
   </ul>
  </div>
 </div>
 
 <div class="refsect1 description" id="refsect1-function.mcrypt-cbc-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mcrypt_cbc</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$cipher</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$data</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$mode</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$iv</code></span>
  ] ) : <span class="type">string</span></div>

  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mcrypt_cbc</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$cipher</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$data</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$mode</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$iv</code></span>
  ] ) : <span class="type">string</span></div>

  <p class="para rdfs-comment">
   第一个原型是针对 libmcrypt 2.2.x 的，
   第二个原型是针对 libmcrypt 2.4.x 及更高版本的。
   <code class="parameter">mode</code> 可选值为：
   <strong><code>MCRYPT_ENCRYPT</code></strong> 或
   <strong><code>MCRYPT_DECRYPT</code></strong>。
  </p>
 </div>

</div></div></div></body></html>